<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">

    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-leave-edit" th:object="${leave}">
            <input id="leaveId" name="leaveId" th:field="*{leaveId}"  type="hidden">
			<div class="form-group" >
				<h4 class="col-sm-3 control-label">请假信息：</h4>
				<div class="col-sm-8">
					<ul>
						<li>
							<p th:text="'请假课程:&nbsp&nbsp'+ ${leave.course.courseName}"></p>
						</li>
						<li>
							<p th:text="'请假学生:&nbsp&nbsp'+ ${leave.student.userName}"></p>
						</li>
						<li>
							<p th:text="'请假理由:&nbsp&nbsp'+ ${leave.reason}"></p>
						</li>
						<li>
							<p th:text="'请假时间:&nbsp&nbsp'+ ${leaveTimeStr}"></p>
						</li>
					</ul>
				</div>
			</div>
			<div class="form-group">
				<h4 class="col-sm-3 control-label">审核：</h4>
				<div class="col-sm-8">
					<select id="approvalStatus" class="form-control select2-hidden-accessible">
						<option value="通过">通过</option>
						<option value="未通过" >未通过</option>
						<option value="待审核" >待审核</option>
					</select>
				</div>
			</div>

		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/leave";
		$("#form-leave-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	var approvalStatus=$.form.selectSelects("approvalStatus");
	        	var data=$('#form-leave-edit').serializeArray();
	        	data.push({"name":"approvalStatus","value":approvalStatus});
	            $.operate.save(prefix + "/edit", data);
	        }
	    }
	</script>
</body>
</html>
